package ptij.vocoder.baseModel.open_loop;

import ptolemy.actor.*;
import ptolemy.kernel.*;
import ptolemy.kernel.util.*;
import ptolemy.data.ObjectToken;
import ptolemy.data.BooleanToken;
import ptolemy.data.expr.Parameter;
import ptolemy.data.type.*;

import ptij.vocoder.baseModel.*;

//////////////////////////////////////////////////////////////////////////
//// PitchOI
/**

@author Ivan Jeukens
@version v 0.1 07/08/2003
*/
public class PitchOl extends TypedAtomicActor {

    public PitchOl(CompositeEntity container, String name) throws
            IllegalActionException, NameDuplicationException {
        super(container, name);

        signal = new TypedIOPort(this, "signal", true, false);
        signal.setTypeEquals(BaseType.OBJECT);

        p_maxl = new TypedIOPort(this, "p_maxl", false, true);
        p_maxl.setTypeEquals(BaseType.OBJECT);
    }

    ///////////////////////////////////////////////////////////////////
    ////                     ports and parameters                  ////

    // Input ports
    public TypedIOPort signal;

    // Output Ports
    public TypedIOPort p_maxl;

    ///////////////////////////////////////////////////////////////////
    ////                         public methods                    ////

    public void fire() throws IllegalActionException {
        ObjectToken obj = (ObjectToken) signal.get(0);
        Short [] arg1 = (Short []) obj.getValue();

        Short [] res = new Short[1];
        res[0] = _pitch_ol(arg1);

        obj = new ObjectToken(res);
        p_maxl.broadcast(obj);
    }

    ///////////////////////////////////////////////////////////////////
    ////                         private methods                   ////

    private Short _pitch_ol(Short [] signal) {

        return new Short((short)0); 
    }

    ///////////////////////////////////////////////////////////////////
    ////                         private variables                 ////


}

